import { http4 } from "@/service/axios";

//  获取班组排班信息列表接口
export function getScheduleList(data) {
    // console.log("data ===>", data);
  
    return http4.get({
      url: `/road/duty/schedule/list/by/${data.teamId}/${data.dutyDate}`,
      data,
    });
}
  
// 班次信息列表get
export function getShiftList(data) {
    return http4.get({
      url: "/road/shift/list",
      data,
    });
}
  
// 通过历史数据设置排班
export function setScheduleByHistory(data) {
    return http4.post({
      url: "/road/duty/schedule/import/from/history",
      data,
    });
}

// 新增班组排班信息
export function addSchedule(data) {
  return http4.post({
    url: `/road/duty/schedule/add`,
    data,
  });
}
  
// 编辑班组排班信息
export function editSchedule(data) {
    return http4.post({
      url: `/road/duty/schedule/edit`,
      data,
    });
}
  
// 日历列表
export function getCalendar(data) {
  return http4.get({
    url: `/road/duty/schedule/date/list/by/${data.teamId}/${data.year}/${data.month}`,
    data,
  });
}

// 排班信息导入模板接口
export function getExportScheduling(data) {
  return http4.get({
    url: `/road/duty/schedule/import/template/download`,
    data,
    responseType: "blob",
  });
}